package com.bingo.controller;

import com.bingo.common.R;
import com.bingo.entity.dto.req.ReqBody;
import com.bingo.service.SummaryService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

/**
 * @author Bingo
 * @version 1.0
 * @description 汇总控制类
 * @date 2024/3/21 12:37
 */

@RestController
@RequestMapping("/summary")
public class SummaryController {
    private SummaryService summaryService;
    @Autowired
    public void setSummaryService(SummaryService summaryService) {
        this.summaryService = summaryService;
    }

    //塘汇总
    @PostMapping("/pool")
    public R PoolSummary(@RequestBody ReqBody reqBody) {
        return R.success(summaryService.PoolSummary(reqBody));
    }

    //场汇总
    @PostMapping("/site")
    public R SiteSummary(@RequestBody ReqBody reqBody) {
        return R.success(summaryService.SiteSummary(reqBody.getPoolNos(), reqBody.getDate()[0], reqBody.getDate()[1]));
    }

}
